<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="${ctxStatic}/layui-v2.5.6/layui/css/layui.css">
<!--    <link type="text/css" rel="stylesheet" href="layui/css/layui.css" />
   -->
  <script type="text/javascript" src="${ctxStatic}/layui-v2.5.6/layui/layui.js"></script>
  
 </head>
<body>

<div style="margin: 10px;">

   
	<form class="layui-form layui-form-pane" lay-filter="example">
	
	<div class="layui-form-item">
	 	 <input type="hidden" name="id">
	 </div> 
	 <div class="layui-form-item">
	   <!-- <label class="layui-form-label">项目支出名称：</label>
	     <div class="layui-input-inline">
	      <input type="text" name="expendName" id="expendName" autocomplete="off" class="layui-input">
	    </div> -->
	    <label class="layui-form-label">一级指标:</label>
	    <div class="layui-input-inline">
	      <select name="targetOne" lay-search="" required  lay-verify="required">
	      	<option value="">请选择</option>
			<c:forEach items="${fns:getDictList('jx_projectPerformanceReport_targetOne')}" var="targetOne">
				<option value="${targetOne.value}">${targetOne.label}</option>
			</c:forEach>
		  </select>
	    </div>
	     <label class="layui-form-label">二级指标:</label>
	    <div class="layui-input-inline">
	      <select name="targetTow" lay-search="" required  lay-verify="required">
	      	<option value="">请选择</option>
			<c:forEach items="${fns:getDictList('jx_projectPerformanceReport_targetTow')}" var="targetTow">
				<option value="${targetTow.value}">${targetTow.label}</option>
			</c:forEach>
		  </select>
	    </div>
	 </div>
	  <div class="layui-form-item">
		  <label class="layui-form-label">三级指标:</label>
		    <div class="layui-input-inline">
		      <select name="targetThree" lay-search="" required  lay-verify="required">
		      	<option value="">请选择</option>
				<c:forEach items="${fns:getDictList('jx_projectPerformanceReport_targetThree')}" var="targetThree">
					<option value="${targetThree.value}">${targetThree.label}</option>
				</c:forEach>
			  </select>
	    </div>
	  
	  
	  </div>
	   <div class="layui-form-item layui-form-text">
				<label class="layui-form-label">指标值:</label>
				<div class="layui-input-block">
				  <textarea name="targetValue" placeholder="请输入内容" class="layui-textarea"></textarea>
				</div>
		</div>  
	 
	  <div class="layui-form-item">
		  <label class="layui-form-label">绩效标准:</label>
		    <div class="layui-input-inline">
		      <select name="performanceStandards" lay-search="" required  lay-verify="required">
		      	<option value="">请选择</option>
				<c:forEach items="${fns:getDictList('jx_projectPerformanceReport_performanceStandards')}" var="performanceStandards">
					<option value="${performanceStandards.value}">${performanceStandards.label}</option>
				</c:forEach>
			  </select>
	    </div>
	  </div>
	   <div class="layui-form-item layui-form-text">
				<label class="layui-form-label">备注:</label>
				<div class="layui-input-block">
				  <textarea name="remarks" placeholder="请输入内容" class="layui-textarea"></textarea>
				</div>
		</div>  
	  <div class="layui-form-item">
	    <div class="layui-input-block">
	      <button class="layui-btn" id="submitBtn" lay-submit lay-filter="formDemo">立即提交</button>
	      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
	    </div>
	  </div>
	</form>
</div>
	 
  
<script>

layui.use(['form', 'laydate'], function(){
	var form = layui.form;
	var laydate = layui.laydate;
	var $ = layui.$;
	
	/* 
	//日期
	 laydate.render({
	   elem: '#fillInDate',
	   trigger: 'click', //采用click弹出
	   value: new Date()
	});   
	 laydate.render({
		   elem: '#approvalDate',
		   trigger: 'click', //采用click弹出
		   value: new Date()
		}); 
	 laydate.render({
		   elem: '#createDate',
		   trigger: 'click', //采用click弹出
		   value: new Date()
		}); 
	 laydate.render({
		   elem: '#updateDate',
		   trigger: 'click', //采用click弹出
		   value: new Date()
		}); */ 
	
	//表单赋值
	form.val('example', {		
	     	 "id": "${projectPerformanceReport.id}"
	     	 ,"targetOne":"${projectAimTarget.targetOne}"
	     	 ,"targetTow":"${projectAimTarget.targetTow}"
	     	 ,"targetThree":"${projectAimTarget.targetThree}"
	     	 ,"targetValue":"${projectAimTarget.targetValue}"
	     	 ,"performanceStandards":"${projectAimTarget.performanceStandards}"
	     	 ,"createBy":"${projectAimTarget.createBy}"
	     	 /* ,"updateDate":"${projectAimTarget.updateDate}" */
	     	 ,"remarks":"${projectAimTarget.remarks}"
 });
	//监听提交
	form.on('submit(formDemo)', function(data){
		$('#submitBtn').addClass("layui-btn-disabled").attr("disabled",true);
		var aa = JSON.stringify(data.field);
		$.ajax({
            url: "${ctx}/jx/projectAimTarget/save",
            type: "POST",
            dataType: "json",
            data: {
            	dataString : aa
            },
            async: false,
            success: function(data){
                layer.msg(data,{time:1*500},function(){
                    var iframe_index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(iframe_index); //再执行关闭      
                    parent.layui.table.reload('thisReloadId');
                });
            },
            error: function(){
            	layer.msg('保存失败', {icon: 2});
            	$('#submitBtn').removeClass("layui-btn-disabled").attr("disabled",false);
            }
        });
		return false;
	});
	
}); 
</script>


  

</body> 
</html>

